package inicio;

import conexao.HibernateUtil;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.hibernate.HibernateException;

public class Inicio extends Application{
    
    public static void main(String[] args) {
        try{
            HibernateUtil.getSessionFactory().openSession().createQuery("FROM Contafinanceira");
        }catch(HibernateException ex){
            HibernateUtil.criaTabelasAutomaticamente();
        }
        launch();
    }

    @Override
    public void start(Stage stage) throws Exception {
        Parent parent = FXMLLoader.load(getClass().getResource("/janelaPrincipal/JanelaPrincipal.fxml"));
        stage.setScene(new Scene(parent,1024,768));
        stage.centerOnScreen();
        stage.show();
    }
    
}